export function getEnv(key, hasPrefix = true){
  if('VITE'){
    if(key === 'NODE_ENV') key = "MODE"
    return import.meta.env[hasPrefix?'VITE_'+key:key]
  }
  return process.env[hasPrefix?'VUE_'+key:key]
}

export function changeIframeEnv(url) {
  let env = getEnv('NODE_ENV', false)
  console.log('env', env)
  if(url.indexOf('http://172.16.35.3:31984')>-1){
    if(env === 'preview'){
      url = url.replace('http://172.16.35.3:31984', 'https://sdyw.scgsdsj.com:10243')
    }else if(env === 'production'){
      url = url.replace('http://172.16.35.3:31984', 'https://sdyw.scgsdsj.com')
    }
  }
  return url
}
